package com.itheima.homework;

import java.util.Scanner;

/*4、  【编号：804】

        键盘录入一个字符串，统计该字符串中大写字母字符，
        小写字母字符，数字字符出现的次数(不考虑其他字符)*/
//考察toCharArray
public class HomeWork04 {
    public static void main(String[] args) {
        int smallCount=0;
        int bigCount=0;
        int numberCount=0;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串以统计大小写以及数字字符的数量");
        String str = sc.nextLine();
        char[] chars = str.toCharArray();
        for (int i = 0; i < chars.length; i++) {char c=chars[i];
            if (c>='A'&&c<='Z'){
                bigCount++;
            }
            if (c>='a'&&c<='z'){
                smallCount++;
            }
            if (c>='0'&&c<='9'){
                numberCount++;
            }
        }
        System.out.println("numberCount = " + numberCount);
        System.out.println("bigCount = " + bigCount);
        System.out.println("smallCount = " + smallCount);

    }
}
